//
//  JWGRStuCell.m
//  koubei
//
//  Created by 李彦宏 on 2018/4/20.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "JWGRStuCell.h"
#define SFont 14  //字体大小

@implementation JWGRStuCell


//类方法快速创建cell
+(instancetype)cellwithTableview:(UITableView *)tableview{
    
    // 1.创建cell
    static NSString *ID = @"cell10";
    JWGRStuCell *cell = [tableview dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[JWGRStuCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return  cell;
    
}
/**
 *  cell的初始化方法，一个cell只会调用一次
 *  一般在这里添加所有可能显示的子控件，以及子控件的一次性设置
 */
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加UI控件
        [self setUI];
        
    }
    return self;
}

-(void)setUI{
    UILabel *lb1=[[UILabel alloc]initWithFrame:CGRectMake(0, 5, 80, 30)];
    lb1.text=@"爱因斯坦";
    lb1.font=[UIFont systemFontOfSize:SFont];
    lb1.textAlignment=NSTextAlignmentCenter;
    self.lb1=lb1;
    [self.contentView addSubview:lb1];
    
    
    UILabel *lb2=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth/2-90, 5, 180, 30)];
    lb2.text=@"13999999999";
    lb2.font=[UIFont systemFontOfSize:SFont];
    lb2.textAlignment=NSTextAlignmentCenter;
    self.lb2=lb2;
    [self.contentView addSubview:lb2];
    
    
    UILabel *lb3=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-65, 5, 50, 30)];
    lb3.text=@"18";
    lb3.font=[UIFont systemFontOfSize:SFont];
    lb3.textAlignment=NSTextAlignmentCenter;
    self.lb3=lb3;
    [self.contentView addSubview:lb3];
    
    
}
-(void)setModel:(SDUserModel *)model{
    _model=model;
    self.lb1.text=_model.name;
    self.lb2.text=_model.phone;
    self.lb3.text=_model.jieshu;

}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
